<?php

include( "./admin/include/func.php");
include( "./admin/include/thumb.php");

if (isset( $_GET['inpSorszam']) && isset( $_GET['inpAktivkod']) && isset( $_GET['Ok'])) {
	
	$g_azonosito  =  $_GET['inpSorszam'];
	$g_kod        = trim( strip_tags( $_GET['inpAktivkod']));
	$g_op         = trim( strip_tags( $_GET['Ok']));

	$db->sql = "SELECT id FROM hirdetes WHERE azonosito='$g_azonosito' AND aktivkod='$g_kod'";
	$db->query();
	$rs = mysql_fetch_row( $db->rs);
	$g_id = (int)$rs[0];
	
	if ($g_id > 0) {
						
		$script = '';
		
		switch ($g_op) {
			case 'sbtAktivalOnClick':
				$script = 'hirdetes-aktivalas.php';
			break;
			case 'sbtModositOnClick':
				$script = 'hirdetes-modositas.php';
			break;
			case 'lnkHosszabitOnClick':
				$script = 'hirdetes-hosszabbitas.php';
			break;
			case 'sbtTorlesOnClick':
				$script = 'hirdetes-torles.php';
			break;
		}
			
		if ($script != '') {
			$location = "Location: $script?sorszam=$g_id&kod=$g_kod";			
			header( $location);
			exit();
		}
	}
}

header( 'Location: hirdetesek.php?list=osszes');

?>
